package o;

import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.protocol.ITabFragmentProtocol;
import java.util.HashMap;
import java.util.Map;

public class cju {
    private static String ˎ = null;
    private static Map<String, String> ˏ = new HashMap();

    public static boolean ˏ(String str) {
        if (ˏ == null || dof.ˋ(str)) {
            return false;
        }
        if (ˏ.get(ॱ(str)) == null && ˏ.get(ˋ(str)) == null) {
            return false;
        }
        return true;
    }

    public static String ˊ(String str) {
        if (str == null) {
            return null;
        }
        String str2 = (String) ˏ.get(str);
        if (str2 == null) {
            str2 = (String) ˏ.get(ॱ(str));
        }
        if (str2 != null) {
            return str2;
        }
        return (String) ˏ.get(ˋ(str));
    }

    public static void ॱ(String str, String str2) {
        ˏ.put(str, str2);
    }

    public static String ˏ() {
        return ˎ;
    }

    public static void ˎ(String str) {
        ˎ = str;
    }

    public static cjm ˋ(String str, chx o_chx) {
        String ˏ;
        String ˊ = ˊ(str);
        if (ˊ == null) {
            ˏ = ˏ();
        } else {
            ˏ = ˊ;
        }
        try {
            cjo o_cjo = (ITabFragmentProtocol) new cjq(ˏ).ˎ().ˏ();
            if (o_cjo == null) {
                Logger.ˋ("TabRegistry", "getTabFragmentOffer failed, protocol == null");
                return null;
            }
            ((chv) o_cjo.ˊ()).ˎ(o_chx);
            return new cjm(ˏ, o_cjo);
        } catch (IllegalArgumentException e) {
            Logger.e("TabRegistry", "getTabFragmentOffer IllegalArgumentException!");
            return null;
        } catch (ClassCastException e2) {
            Logger.e("TabRegistry", "getTabFragmentOffer ClassCastException!");
            return null;
        }
    }

    public static String ˋ(String str) {
        if (str == null) {
            return null;
        }
        int indexOf = str.indexOf(124);
        if (indexOf != -1) {
            return str.substring(0, indexOf);
        }
        indexOf = str.indexOf(63);
        if (indexOf != -1) {
            return str.substring(0, indexOf);
        }
        return str;
    }

    public static String ॱ(String str) {
        if (str == null) {
            return null;
        }
        int indexOf = str.indexOf(63);
        if (indexOf != -1) {
            return str.substring(0, indexOf);
        }
        return str;
    }
}
